/**
 * Project: push-center-biz-dal
 * 
 * File Created at 2014年10月9日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.dal.pushcenter.impl;

import java.util.List;

import com.greenline.push.dal.base.BaseDAO;
import com.greenline.push.dal.pushcenter.AppTemplateDAO;
import com.greenline.push.dal.pushcenter.dataobject.AppTemplateDO;
import com.greenline.push.dal.query.AppTemplateQuery;

/**
 * @Type AppTemplateDAOImpl
 * @Desc 
 * @author zhaoli
 * @date 2014年10月9日
 * @Version V1.0
 */
public class AppTemplateDAOImpl extends BaseDAO implements AppTemplateDAO {

	/* (non-Javadoc)
	 * @see com.greenline.push.dal.pushcenter.AppTemplateDAO#insert(com.greenline.push.dal.pushcenter.dataobject.AppTemplateDO)
	 */
	@Override
	public Long insert(AppTemplateDO appTemplate) {
		return (Long) super.getSqlMapClientTemplate().insert("appTemplate.insert", appTemplate);
	}

	/* (non-Javadoc)
	 * @see com.greenline.push.dal.pushcenter.AppTemplateDAO#getAppTemplateById(java.lang.Long)
	 */
	@Override
	public AppTemplateDO getAppTemplateById(Long id) {
		return (AppTemplateDO) super.getSqlMapClientTemplate().queryForObject("appTemplate.find_by_id", id);
	}

	/* (non-Javadoc)
	 * @see com.greenline.push.dal.pushcenter.AppTemplateDAO#update(com.greenline.push.dal.pushcenter.dataobject.AppTemplateDO)
	 */
	@Override
	public int update(AppTemplateDO appTemplate) {
		return super.getSqlMapClientTemplate().update("appTemplate.update", appTemplate);
	}

	/* (non-Javadoc)
	 * @see com.greenline.push.dal.pushcenter.AppTemplateDAO#listByQuery(com.greenline.push.dal.query.AppTemplateQuery)
	 */
	@Override
	public AppTemplateQuery listByQuery(AppTemplateQuery query) {
		return (AppTemplateQuery) super.listByQuery("appTemplate.list_by_query", query);
	}

	/* (non-Javadoc)
	 * @see com.greenline.push.dal.pushcenter.AppTemplateDAO#delete(java.lang.Long)
	 */
	@Override
	public int delete(Long id) {
		return super.getSqlMapClientTemplate().delete("appTemplate.delete", id);
	}

    @SuppressWarnings("unchecked")
    @Override
    public List<AppTemplateDO> listByExample(AppTemplateDO appTemplateDO) {
        return  getSqlMapClientTemplate().queryForList("appTemplate.find_by_example", appTemplateDO);
    }
}
